<#include "/frame/_layout.ftl"/>
<@layout page_tab="memberInfo">

<div class="contextMenu hidden" id="jqgridMenu">
	<ul>
		<li id="edit"><a option='modalEdit' href='${basePath}/admin/memberInfo/edit.do?navTabId=editMemberInfo&id=' class=''><i class='glyphicon glyphicon-detail'></i> 编辑</a></li>
		<li id="detail"><a option='modalDetail' href='${basePath}/admin/memberInfo/detail.do?navTabId=editMemberInfo&id=' class=''><i class='glyphicon glyphicon-detail'></i> 详细</a></li>
		<li id="tallyAccoutInfo"><a option='modalView' href='${basePath}/admin/memberInfo/tallyAccoutInfo.do?navTabId=editMemberInfo&id=' class=''><i class='glyphicon glyphicon-detail'></i> 账户信息</a></li>
	</ul>
</div>

<div id="right-sidebar">
	<div class="sidebar-container">
	<form id="searchForm">
		<div class="ibox-content">
			<a class="pull-right right-sidebar-toggle" aria-expanded="false"><i class="close fa fa-times-circle-o" style="font-size: 25px"></i></a>
			<div class="">&nbsp;</div>
			<div class="common-search">
				<div class="form-group">
					<label class="control-label">用户编号：</label>
					<div class="">
						<input type="text" class="form-control" name="userNo" value="" />
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">用户名：</label>
					<div class="">
						<input type="text" id="userName" class="form-control" name="userName" value="" />
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">用户类型：</label>
					<div class="">
						<select name="accountType" class="form-control">
							<option value="">全部</option>
							<option value="PERSONAL">个人</option>
							<option value="ENTERPRISE">企业</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">创建日期：</label>
					<div class="">
						<div class="input-append form-group" >
							<input class="laydate-icon form-control layer-date" id="dateStart" value='' onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name="dateStart" readOnly style="cursor: pointer; " />
							<span class="limit">-</span>
							<input class="laydate-icon form-control layer-date" id="dateStart" value='' onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name="dateEnd" readOnly style="cursor: pointer; " />
						</div>
					</div>
				</div>
				<div class="">
					<button class="btn btn-primary btn-sm col-sm-12" type="button" onclick="search('searchForm')">查询</button>
					<div class="hr-line-dashed col-sm-12"></div>
					<li class="dropdown hidden-xs">
                        <a class="btn btn-danger btn-sm col-sm-12 right-sidebar-toggle" aria-expanded="false">关闭</a>
                    </li>
				</div>
			</div>
		</div>
		</form>
	</div>
</div>


<div class="ibox">
    <div class="ibox-title">
    	<div id="toolbar">
			<div class="page-toolbar form-inline">
				<div class="btn-group">
					<a option="selectModalAdd" href="${basePath}/admin/memberInfo/add.do" class="btn btn-outline btn-default" type="button"><i class="fa fa-plus"></i> 新建</a>
					<a option="selectDelete" href="${basePath}/admin/memberInfo/batchDelete.do" class="btn btn-outline btn-default" type="button" ><i class="fa fa-trash"></i> 删除</a>
					
					<div class="form-group" style="margin-left:10px;">
						<form id="search-bar">
							<input type="text" class="form-control" name="userName" value="" placeholder="用户名" />
							<input type="text" class="form-control" name="userNo" value="" placeholder="用户编号" />
							<button class="btn btn-primary btn-sm " type="button" onclick="search('search-bar')"> 搜索</button>
						</form>
					</div>
					<a option="selectModalEdit" href="${basePath}/admin/memberInfo/edit.do?id={sid_obj}" class="btn btn-default btn-outline" type="button"><i class="fa fa-paste"></i> 编辑</a>
					
				</div>
    			<div class="page-search btn-group pull-right">
    				<a class="right-sidebar-toggle btn btn-outline btn-default" aria-expanded="false"><i class="fa fa-search"></i> 更多搜索</a>
    			</div>
    		</div>
    		
		</div>
    </div>
	<div class="ibox-content">
		<div class="pageContent">
	
			<table id="table"></table>
			<div id="pager"></div>
		</div>
	</div>
</div>
<script>
	
	var options = {
        url:"${basePath}/admin/memberInfo/list.do",
        tableId:"table",
        updateurl:"${basePath}/admin/memberInfo/update.do",//更新url，实现更新不可少
        pager:"#pager",
        prmNames: {
             		sort: "sort",
             		order: "order",
             		search: "search"
             	},
        colModel: [
			{
				name: 'id',
				index: 'id',
				label: 'id',
				width: 300,
				sorttype: "int",
				hidden:true,
				search:true, 
				stype:'text', 
				searchoptions:{sopt:['eq','cn'],attr:{title:'Select Name'}}
			},
			{
				name: 'userNo',
				index: 'userNo',
				label: '用户编号',
				width: 400
			},
			{
				name: 'userName',
				index: 'userName',
				label: '用户名',
				editable:true,
				edittype:'text',
				width: 400
			},
			{
				name: 'accountType',
				index: 'accountType',
				label: '用户类型',
				width: 220
			},
			{
				name: 'createTime',
				index: 'createTime',
				label: '创建时间',
				width: 300,
				date:true
			},
			{
				name: 'edit_btn',
				index: '',
				width: 300,
				label:'操作',
				formatter: function (value, grid, rows, state) {
					var editBtn = "<a option='modalEdit' href='${basePath}/admin/memberInfo/edit.do?navTabId=editMemberInfo&id=" + rows.id +"' class='btn btn-default btn-xs'><i class='glyphicon glyphicon-edit'></i> 编辑</a>";
					var detailBtn = "<a option='modalDetail' href='${basePath}/admin/memberInfo/detail.do?navTabId=detail&id=" + rows.id +"' class='btn btn-info btn-xs'><i class='glyphicon glyphicon-paste'></i> 详细</a>";
					var accountInfoBtn = "<a option='modalView' href='${basePath}/admin/memberInfo/tallyAccoutInfo.do?id=" + rows.id +"' class='btn btn-success btn-xs'><i class='glyphicon glyphicon-paste'></i> 账户信息</a>";
					return editBtn + " " + detailBtn + " " + accountInfoBtn;
				}
			}
		]
	}
	
	$(function () {
		common_jqgrid.createOptions(options);
		common_jqgrid.init();
    	
	});

</script>
</@layout>